package featuresdemo;

/**
 * Created by g705353 on 10/29/2014.
 * 测试静态初始化化*
 */
public class StaticBlockTest {
    // init block run before constructor
    {
        a = 3;  //only work when instance created
//        c is not staitc, can't init before instance created
        c = 49;
    }
    static int a = 1;
    static int b;
    int c = 100;

    StaticBlockTest(){
        a = 8;
        c = 33;
    }
    public static void main(String args[]) {
        StaticBlockTest st = new StaticBlockTest();
//        System.out.println("a: " + StaticTest.a + ", b:" + StaticTest.b );
        System.out.println("a: " + StaticBlockTest.a + ", b:" + StaticBlockTest.b + ", c: " + st.c);
    }
}
